<% title_tag @page.title %>

<div class="row">
  <%= render 'sidebar' %>
  <div class="col-sm-9 page-detail">
    <div class="panel panel-default">
      <% if !@page.locked or admin? %>
          <div class="panel-heading">
            <h1><%= @page.title %></h1>
            <div class="infos">
              <%= link_to comments_page_path(@page.slug) do %>
                  <%= @page.comments_count %> 条评论
              <% end %>,
              版本 <%= render_page_version(@page) %>， <%= t("common.last_modified_at")%> <%= render_page_updated_at(@page) %>
              <span class="pull-right opts">
              <%= render_edit_page_button(@page) if can? :edit, @page %>
            </span>
            </div>
          </div>

      <% end %>

      <div class="panel-body markdown">
        <article>
          <%= raw @page.body_html %>
        </article>
      </div>

      <div class="editors panel-footer clearfix">
        <div class="heading">
          <%= t("pages.wiki_page_contributors")%>
          <span class="pull-right"><%= social_share_button_tag h("#{@page.title} via: @#{Setting.twitter_id} ") %></span>
        </div>
        <div class="avatars">
          <% @page.editors.each do |item| %>
              <%= user_avatar_tag(item, :small) %>
          <% end %>
        </div>
        <div class="buttons">
          <%= link_to "发表评论", comments_page_path(@page.slug, anchor: "new_comment"), class: "btn btn-success" %>
        </div>
      </div>
    </div>
  </div>
</div>